<template>
  <div class="app-container">
    <el-tabs v-model="activeName" type="card" @tab-remove="removeTab" @tab-click="tabclick">
      <el-tab-pane label="巡检计划" name="1">
        <template v-if="activeName === '1'">
          <BaseValue></BaseValue>
        </template>
      </el-tab-pane>
      <el-tab-pane label="计划明细" name="2">
        <template v-if="activeName === '2'">
          <SubsetManagement></SubsetManagement>
        </template>
      </el-tab-pane>
      <template v-if="tabIndex">
        <el-tab-pane label="计划详情" name="3" closable>
          <template v-if="activeName === '3'">
            <Detailed :rowObj="rowObj"></Detailed>
          </template>
        </el-tab-pane>
      </template>
    </el-tabs>
  </div>
</template>

<script>
import BaseValue from './basevalue/index.vue'
export default {
  /**
   * 这个模块我很多都是直接CV过来的，有很多多余的方法和代码，要一天就开发出来，很急，这块代码有点乱，
   * 我没怎么处理
   */
  name: "plan",
  // dicts: ['sys_notice_status', 'sys_notice_type'],
  components: {
    // BaseValue: ()=> import('./basevalue/index.vue'),//
    BaseValue,
    SubsetManagement: () => import('./subsetmanagement/index.vue'),//明细
    Detailed: () => import('./basevalue/form/detailed.vue'),//详情
    // operationTable: ()=> import('./operation-table/index.vue')
  },
  data () {
    return {
      activeName: '1',
      tabIndex: false,
      rowObj: {}
    };
  },
  created () {
  },
  methods: {
    tabclick () {
      if (this.activeName === '3') {
        return
      }
      this.tabIndex = false
      this.rowObj = {}
    },
    removeTab () {
      this.tabIndex = false
      this.activeName = '1'
    },
    // addTab(row){
    //   this.tabIndex = true
    //   this.activeName = '3'
    //   this.rowObj = row
    // }
  }
};
</script>
